﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OF.Common;
namespace OF.Web.user
{
    public partial class register : BuyerAdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {

            OF.BLL.User.User bll_buyer = new BLL.User.User();

            int newid = bll_buyer.doWebSendUser(txtloginname.Text, txtpwd.Text, txtloginname.Text);
            if (newid > 0)
            {
                WebUtils.AddSession(txtloginname.Text, newid.ToString());
                MessageBox.ShowAndRedirect(this, "注册成功", "/user/index.aspx");
            }
            else if (newid == -1)
            {
                MessageBox.Show(this, "登录名已经存在");
            }
            else
            {
                MessageBox.Show(this, "注册失败");
            }

        }
    }
}